package View;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * Frame for the configuration screen
 */
public class ConfigFrame extends JFrame 
{
	private JPanel configPanel;
    private JPanel startPanel;
    private CardLayout cardlayout;

	/**
	 * Create the frame.
	 */
	public ConfigFrame()
	{
        MouseAdapter m = new MouseAdapter()
        {
            @Override
            public void mouseClicked(MouseEvent e)
            {
                showConfigPanel();
            }
        };
        this.startPanel = new StartPanel(m);
		this.configPanel = new ConfigPanel();
		configPanel.setLayout(null);

        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setBounds(100, 100, 1296, 750);

        this.cardlayout = new CardLayout();
        getContentPane().setLayout(cardlayout);
        getContentPane().add(this.startPanel, "Start");
        getContentPane().add(this.configPanel, "Config");
	}

    public void showConfigPanel()
    {
        cardlayout.show(this.getContentPane(), "Config");
    }

    public void showStartScreen()
    {
        cardlayout.show(this.getContentPane(), "Start");
    }

}
